-
Notifications
You must be signed in to change notification settings - Fork 50
fix: replace -
and .
with _
in generated C header
#895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: replace -
and .
with _
in generated C header
#895
Conversation
`-` and `.` are not legal in the name of a `#define` in C. This replaces `-` and `.` with `_` in CSR and exception code names in the generated C header, as is already done for instruction names.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #895 +/- ##
=======================================
Coverage 43.30% 43.30%
=======================================
Files 10 10
Lines 4787 4787
Branches 1298 1298
=======================================
Hits 2073 2073
Misses 2714 2714
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
It would be nice to before/after examples in the commit/PR message. I was going to add them, but I just haven't gotten to it, yet. |
Currently, invalid examples are emitted in the "C header" (
With proposed changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the PR message. (I hope that's OK.)
Perfect. Thanks @ThinkOpenly! |
I must have fixed this on instructions and forgot the rest. Thanks! |
-
and.
are not legal in the name of a#define
in C. This replaces-
and.
with_
in CSR and exception code names in the generated C header, as is already done for instruction names.Currently, invalid examples are emitted in the "C header" (
gen/c_header/encoding.out.h
) generated via./do gen:c_header
, for example:With proposed changes: